package com.qf.userweb.utils;

import lombok.Data;

@Data
public class R {
    private Integer code;
    private String msg;
    private Object data;

    public static R ok(){
        R r = new R();
        r.setCode(200);
        r.setMsg("成功");
        return r;
    }
    public static R ok(Integer code,String msg,Object data){
        R r = new R();
        r.setCode(200);
        r.setMsg("成功");
        r.setData(data);
        return r;
    }
    public static R ok(Object data){
        R r = new R();
        r.setCode(200);
        r.setMsg("成功");
        r.setData(data);
        return r;
    }
    public static R fail(String msg){
        R r = new R();
        r.setCode(400);
        r.setMsg(msg);
        return r;
    }
    public static R fail(){
        R r = new R();
        r.setCode(400);
        r.setMsg("失败");
        return r;
    }

}
